import request from '../../router/axios'

export const getSysbusitypeByTableName = tableName => request({ // 通过业务资源实体表名查询其启用的类型
  url: '/admin/sysbusitype/list/enabled/bytablename',
  method: 'get',
  params: {
    tableName
  }
})

export const getBusistateByTableName = (tableName, typeId, stateId) => request({ // 根据业务资源实体表名和类型id查询启用的状态
  url: '/admin/busistate/list/bymanual',
  method: 'get',
  params: {
    tableName,
    typeId,
    stateId
  }
})

export const getInfo = (objectId, tableName) => request({ // 根据表名和对象id查询类型和状态
  url: '/admin/busitypestate/info',
  method: 'get',
  params: {
    objectId,
    tableName
  }
})

export const getFirstState = (tableName, typeId) => request({ // 根据类型id获取第一个状态
  url: '/admin/busistate/first/bytypeid',
  method: 'get',
  params: {
    tableName,
    typeId
  }
})
